package com.lhf.userservice.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.lhf.userservice.dao.FvsSysUserDao;
import com.lhf.userservice.entity.FvsSysUser;
import com.lhf.userservice.service.FvsSysUserService;
import com.lhf.userservice.vo.FvsSysAddRoleForUserVo;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * (FvsSysUser)表服务实现类
 *
 * @author liuhf
 * @since 2021-03-29 16:01:45
 */
@Service("fvsSysUserService")
public class FvsSysUserServiceImpl extends ServiceImpl<FvsSysUserDao, FvsSysUser> implements FvsSysUserService {

    @Resource
    private FvsSysUserDao fvsSysUserDao;


    /**
     * 给用户添加角色
     *
     * @param uid
     * @param rids
     * @return
     */
    @Override
    public Boolean addRoleByUid(Long uid, List<Long> rids) {
        return this.fvsSysUserDao.addRoleByUid(uid, rids) > 0;
    }

    /**
     * 删除用户角色
     *
     * @param vo
     * @return
     */
    @Override
    public Boolean delRoleByUid(FvsSysAddRoleForUserVo vo) {
        return this.fvsSysUserDao.delRoleByUid(vo.getUid(), vo.getRids()) > 0;
    }

}
